<?php
/**
 * Created by PhpStorm.
 * User: 13469
 * Date: 2018/12/12
 * Time: 11:04
 */
include "config.php";
if(isset($_REQUEST["u_id"])&&isset($_REQUEST["c_id"])){
    $UID=$_REQUEST["u_id"];
    $CID=$_REQUEST["c_id"];
    $sql="DELETE FROM carts WHERE c_id=? AND u_id=?";
    $stmt=$conn->prepare($sql);
    $stmt->bind_param("ii", $CID,$UID);
    $stmt->execute();
    if($stmt->affected_rows>=1){
        print_r(json_encode(array("status"=>1,"msg"=>"删除成功")));
    }else{
        print_r(json_encode(array("status"=>-1,"msg"=>"删除失败")));
    }
}